<?php
namespace Admin\Controller;
use Think\Controller;
header("Content-Type:text/html; charset=utf-8");
class LoginController extends Controller {
    public function indexAction(){
      $index=D('Login');
      $result=$index->index();
      $this->assign('list',$result);
    	$this->display();
 
  }
  	public function loginAction(){
  		$index=D('Login');
    	$result=$index->login();
        if ($result==1) {
            $this->success('登录成功',U('Index/index'),1);
        }
        if ($result==2) {
            $this->error('登录失败，请重新登录',U('Login/index'),1);
        }
        
  	}
  
	public function exitAction(){
     	session(null);
		$this->success('退出成功',U('Login/index'),1);
    }
}